#include "ComFun.h"
#include<QCoreApplication>

CComFun::CComFun(void)
{
}

CComFun::~CComFun(void)
{
}

long CComFun::RandomNum( long N )
{
    std::vector<long> vl( N );
    for ( long i=0; i<N; ++i )
    {
        vl[i] = i;
    }
    std::random_shuffle( vl.begin(), vl.end() );
    return (*vl.begin());
}

void CComFun::SleepSecs(int iSec){
    QTime t;
    t.start();
    while(t.elapsed()< iSec * 1000)
        QCoreApplication::processEvents();
}
